package com.rtx.wms.std.so.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.rtx.api.annotation.DataSourceAnnotation;
import com.rtx.wms.std.so.bean.bak.ApiOrderdetailBak;
import com.rtx.wms.std.so.bean.bak.ApiOrdersBak;
import com.rtx.wms.std.so.mapper.bak.ApiOrderdetailBakMapper;
import com.rtx.wms.std.so.mapper.bak.ApiOrdersBakMapper;
import com.rtx.wms.std.so.service.ApiOrdersBakService;

@Service
public class ApiOrdersBakServiceImpl extends ServiceImpl<ApiOrdersBakMapper, ApiOrdersBak> implements ApiOrdersBakService{

	@Autowired
	ApiOrdersBakMapper apiOrdersBakMapper;
	
	@Autowired
	ApiOrderdetailBakMapper apiOrderdetailBakMapper;
 	
	@DataSourceAnnotation
	@Override
	public void addApiOrders(String whseid, ApiOrdersBak apiOrders) {
        for(ApiOrderdetailBak apiOrderdetail : apiOrders.getDetails()){
        	apiOrderdetailBakMapper.insert(apiOrderdetail);
        }
        apiOrdersBakMapper.insert(apiOrders);
	}
}
